<div class="col-lg-4">
  <!-- category -->
  <div class="widget">
    <h4 class="widget-title">Category</h4>
    {{- if isset .Site.Taxonomies "categories" }}
    {{- if not (eq (len .Site.Taxonomies.categories) 0) }}
    <ul class="list-unstyled">
      {{ if eq .Kind "term" }}
        {{ $category := $.Title }}
        {{- range $name, $items := .Site.Taxonomies.categories }}
          {{ if eq $name $category }}
            <li>
              <a class="highlighted" href="{{ `categories/` | relLangURL }}{{ $name | urlize | lower }}">{{ $name | title | humanize }}</a>
            </li>
          {{ else }}
            <li>
              <a href="{{ `categories/` | relLangURL }}{{ $name | urlize | lower }}">{{ $name | title | humanize }}</a>
            </li>
          {{ end }}
        {{- end }}
      {{ else }}
        {{- range $name, $items := .Site.Taxonomies.categories }}
          <li>
            <a href="{{ `categories/` | relLangURL }}{{ $name | urlize | lower }}">{{ $name | title | humanize }}</a>
          </li>
        {{- end }}
      {{ end }}
    </ul>
    {{- end }}
    {{- end }}
  </div>
  <!-- faq -->
  {{ if eq .Kind "term" }}
    {{ $category := $.Title }}
    <div class="widget">
      {{ with .Site.GetPage "/faqs" }}
      <h4 class="widget-title">FAQ</h4>
      <ul class="list-unstyled">
        {{ range sort (where .Site.RegularPages "Type" "faq") ".Params.order" }}
          {{ $slug := .Params.Slug }}
          {{ $title := .Title }}
          {{ range .Params.categories }}
            {{ if in . $category }}
              <li><a
                href="{{ `faqs/` | relLangURL }}#{{ $slug }}">{{ $title }}</a>
              </li>
            {{ end }}
          {{ end }}
        {{ end }}
      </ul>
      <a href="{{ .Permalink }}" class="btn btn-outline-primary">See All FAQs</a>
      {{ end }}
    </div>
  {{ else }}
    <div class="widget">
      {{ with .Site.GetPage "/faqs" }}
      <h4 class="widget-title">FAQ</h4>
      <ul class="list-unstyled">
        {{ range sort (where (where .Site.RegularPages "Type" "faq") ".Params.main" "==" true) ".Params.order" }}
        <li><a
            href="{{ `faqs/` | relLangURL }}#{{ .Params.Slug }}">{{ .Title }}</a>
        </li>
        {{ end }}
      </ul>
      <a href="{{ .Permalink }}" class="btn btn-outline-primary">See All FAQs</a>
      {{ end }}
    </div>
  {{ end }}
  
</div>
